package cn.wolfcode.car.business.service;

import cn.wolfcode.car.business.domain.Goods;
import cn.wolfcode.car.business.domain.GoodsItem;
import cn.wolfcode.car.business.query.GoodsQuery;
import cn.wolfcode.car.common.base.page.TablePageInfo;
import cn.wolfcode.car.common.base.query.QueryObject;
import org.springframework.web.multipart.MultipartFile;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;

/**
 * 岗位服务接口
 */
public interface IGoodsService {

    /**
     * 分页
     * @param qo
     * @return
     */
    TablePageInfo<Goods> query(GoodsQuery qo);

    /**
     * 上传图片功能
     * @param file
     * @return
     * @throws IOException
     */
    String uploading(MultipartFile file) throws Exception;

    /**
     * 新增功能
     * @param goods
     */
    void save(Goods goods);

    /**
     * 读取图片资源
     * @param id
     * @return
     * @throws FileNotFoundException
     */
    String readResource(Long id) throws FileNotFoundException;

    /**
     * 根据ID获取单个
     * @param id
     * @return
     */
    Goods get(Long id);

    /**
     * 修改
     * @param goods
     */
    void update(Goods goods);

    /**
     * 删除
     * @param id
     */
    void remove(Long id);


    TablePageInfo<GoodsItem> goodsItem(Long id, QueryObject qo);
}
